Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Windows.Forms

Public Class FrmCrCanDoiTaiKhoanNhieuThang
    Private thangThis, namThis, thangThat, namThat As String
    Private customerReport As ReportDocument
    Private sqlQuery As String

    Private Sub FrmCrCanDoiTaiKhoanNhieuThang_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        thangThis = Format(CInt(thangThis), "00")
        namThis = CInt(namThis)
        frmLoading.Show()
        sqlQuery = "SELECT t1.recycleID ,t1.ma_taikhoan,t1.nodauvn ,t1.codauvn ,"
        sqlQuery += " t1.psnovn,t1.pscovn,"
        sqlQuery += " t1.lknovn,t1.lkcovn,"
        sqlQuery += " t1.nocuoivn , t1.cocuoivn,t2.ten_tieukhoan as ten_taikhoan "
        sqlQuery += " FROM tbl_dot_temp_toncdtk_nhieuthang as t1 left join tbl_tieukhoan as t2 On t1.ma_taikhoan=t2.ma_tieukhoan "
        sqlQuery += " ORDER BY t1.ma_taikhoan"
        Dim reportPath = Application.StartupPath & "\" & "crTonCanDoiTaiKhoanNhieuThang.rpt"
        customerReport = New ReportDocument()
        customerReport.Load(reportPath)
        customerReport.SetDataSource(moduleReportConfig.GetDataTable(sqlQuery))
        customerReport.SetParameterValue("TThang", thangThis)
        customerReport.SetParameterValue("TNam", namThat)
        customerReport.SetParameterValue("DThang", thangThat)
        customerReport.SetParameterValue("DNam", namThis)
        Me.CrNXTTongHopview.ReportSource = customerReport
        frmLoading.Close()
        frmLoading.Dispose()
    End Sub
    Public Sub setThangThis(ByVal s As String)
        thangThis = s
    End Sub
    Public Sub setNamThis(ByVal s As String)
        namThis = s
    End Sub
    Public Sub setThangThat(ByVal s As String)
        thangThat = s
    End Sub
    Public Sub setNamThat(ByVal s As String)
        namThat = s
    End Sub

End Class
